package sk.stuba.fiit.pki.service;

import java.io.IOException;
import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.security.InvalidKeyException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.SignatureException;
import java.security.UnrecoverableEntryException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CRLException;
import java.security.cert.CertificateException;
import java.util.List;

import org.bouncycastle.ocsp.OCSPException;
import org.bouncycastle.ocsp.OCSPReq;
import org.bouncycastle.ocsp.OCSPResp;
import org.bouncycastle.tsp.TSPException;
import org.bouncycastle.tsp.TimeStampRequest;
import org.bouncycastle.tsp.TimeStampResponse;

import sk.stuba.fiit.pki.ws.schema.beans.CrlRequest;
import sk.stuba.fiit.pki.ws.schema.beans.CrlResponse;
import sk.stuba.fiit.pki.ws.schema.beans.OcspRequest;
import sk.stuba.fiit.pki.ws.schema.beans.OcspResponse;

public interface PkiService {

	public static final String ROOT_CERT_PATH = "root.jks";	
	public static final String CA_ROOT_PATH = "caCert.jks";
	public static final String USER_CERT_PATH = "certMH.jks";
	public static final String TSA_PATH = "tsaCert.jks";	
	
	public static final String CERT_PASSWORD = "password";
	public static final String STORAGE_TYPE = "jks";
	public static final String PATH_FILE_NAME = "C:\\Users\\Administrator\\Desktop\\DP\\devel\\workspace\\pki\\";

	

	public CrlService getCrlService() ;
	public CertificateService getCertificateService() ;
	public SerialService getSerialService() ;
	public TimeStampService getTimeStampService();
	
	public BigInteger allocateCRLSerialNumber() ;
	public BigInteger allocateCertSerialNumber() ;
	public BigInteger allocateTimeStampSerialNumber() ;
	public BigInteger allocateOcspSerialNumber() ;
	
	public TimeStampResponse generateTimeStamp(TimeStampRequest tsRequest) throws UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableEntryException, IllegalArgumentException, IOException, TSPException, GeneralSecurityException;
	public  byte[] getActualCRL(CrlRequest request) throws InvalidKeyException, CRLException, NoSuchProviderException, SecurityException, SignatureException, IOException, UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableEntryException;
	public OcspResponse getOCSPInfo(String issuer, String serialNum);
	public byte[] getCertificaateBySerialNumber(BigInteger serialNumber, String issuer);
	public void cleareAllDatabaze();
	public byte[] getCertificateBySubjectIssuer(String issuer);
}
